<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改商户信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-merchant-edit" th:object="${hzMerMerchant}">
            <input name="merchantId" th:field="*{merchantId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">商户号：</label>
                <div class="col-sm-8">
                    <input th:field="*{merchantId}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">商户名：</label>
                <div class="col-sm-8">
                    <input name="merchantName" th:field="*{merchantName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">商户简称：</label>
                <div class="col-sm-8">
                    <input name="merchantShortName" th:field="*{merchantShortName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">商户电话：</label>
                <div class="col-sm-8">
                    <input name="merchantTelphone" th:field="*{merchantTelphone}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">法人姓名：</label>
                <div class="col-sm-8">
                    <input name="artifName" th:field="*{artifName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">法人身份证号：</label>
                <div class="col-sm-8">
                    <input name="artifId" th:field="*{artifId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">法人手机号：</label>
                <div class="col-sm-8">
                    <input name="mobileNo" th:field="*{mobileNo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开户行许可证：</label>
                <div class="col-sm-8">
                    <input name="bankLicense" th:field="*{bankLicense}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">开户行支行名称：</label>
                <div class="col-sm-8">
                    <input name="bankBranchName" th:field="*{bankBranchName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">银行账号：</label>
                <div class="col-sm-8">
                    <input name="account" th:field="*{account}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商户地址：</label>
                <div class="col-sm-8">
                    <input name="addr" th:field="*{addr}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系人：</label>
                <div class="col-sm-8">
                    <input name="linkMan" th:field="*{linkMan}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系人电话：</label>
                <div class="col-sm-8">
                    <input name="linkManTelphone" th:field="*{linkManTelphone}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系人身份证：</label>
                <div class="col-sm-8">
                    <input name="linkManIdCard" th:field="*{linkManIdCard}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系人邮箱：</label>
                <div class="col-sm-8">
                    <input name="linkEmail" th:field="*{linkEmail}" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">交易笔数；结合tran_fre_type一起控制：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="tranFre" th:field="*{tranFre}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">最低限额；分：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="minFee" th:field="*{minFee}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">最高限额；分：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="maxFee" th:field="*{maxFee}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">商户推广页面：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="publicityPage" th:field="*{publicityPage}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">商户备注：</label>
                <div class="col-sm-8">
                    <input name="remark" th:field="*{remark}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">营业执照号：</label>
                <div class="col-sm-8">
                    <input name="businessLicense" th:field="*{businessLicense}" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">新增用户：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="addUserId" th:field="*{addUserId}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">入驻时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="addTime" th:value="${#dates.format(hzMerMerchant.addTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">签名类型：</label>
                <div class="col-sm-8">
                    <select th:field="*{merchantSignType}" th:value="*{merchantSignType}" name="merchantSignType" class="form-control">
                        <option th:selected="*{merchantSignType==1}" value="1">MD5</option>
                        <option th:selected="*{merchantSignType==2}" value="2">RSA</option>
                    </select>
                </div>
            </div>
            <div class="form-group md5Key">
                <label class="col-sm-3 control-label">商户MD5密钥：</label>
                <div class="col-sm-8">
                    <input name="merchantMd5Key" th:field="*{merchantMd5Key}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group rsaPublickKey">
                <label class="col-sm-3 control-label">商户RSA公钥：</label>
                <div class="col-sm-8">
                    <textarea name="merchantRsaPublickKey" class="form-control">[[*{merchantRsaPublickKey}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">启用状态：</label>
                <div class="col-sm-8">
                    <select th:field="*{status}" th:value="*{status}" name="status" class="form-control">
                        <option th:selected="*{status==1}" value="1">启用</option>
                        <option th:selected="*{status==2}" value="2">暂停</option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "mng/merchant";
        $("#form-merchant-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-merchant-edit').serialize());
            }
        }

        $("input[name='addTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

          $("#merchantSignType").change(function () {
            var selectedId = $("#merchantSignType option:selected").val();
            if (selectedId != 1) {
                $(".md5Key").hide()
                $(".rsaPublickKey").show()
            } else {
                $(".md5Key").show()
                $(".rsaPublickKey").hide()
            }
         });

        $(function () {
         var merchantSignType = $("#merchantSignType option:selected").val();
         if(merchantSignType == 1){
            $(".md5Key").show();
            $(".rsaPublickKey").hide();
         }else{
            $(".md5Key").hide();
            $(".rsaPublickKey").show();
         }

        })

    </script>
</body>
</html>